package com.sesample.seandroidsample;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;

public abstract class SingleFragmentActivity extends FragmentActivity {

  abstract protected Fragment createFragment();

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fragment);
    if (savedInstanceState == null) {
      getSupportFragmentManager().beginTransaction()
      .add(R.id.fragment_container, createFragment())
      .commit();
    }
  }
}
